package com.xj0927.springcloud.service;

import com.xj0927.springcloud.entities.CommonResult;
import com.xj0927.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author: xj0927
 * @Description:
 * @Date Created in 2020-10-28 18:50
 * @Modified By:
 */
@Component  //能够被扫描
@FeignClient(value = "CLOUD-PAYMENT-SERVICE") //配合 EnableFeignClient使用
public interface PaymentFeignService {

    //底层实现是一样的，都是封装service层
    @GetMapping(value = "/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping(value = "/payment/feign/timeout")
    public String paymentFeignTimeOut();
}
